package com.yellowpage.bigdata.action;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.yellowpage.bigdata.data.NspFatallogRequsetSum;
import com.yellowpage.bigdata.service.NspFatallogRequsetSumService;
import com.yellowpage.white.struts.BaseAction;

public class NspFatallogImeiDayCountAction extends BaseAction{
	private NspFatallogRequsetSum nspFatallogRequsetSum;
	private NspFatallogRequsetSumService nspFatallogRequsetSumService;
	
	private String selectedId;
	private String query_logDate;
	private String query_requestType;
	private String query_logDate_end;
	private List<Map> resultList = new ArrayList<Map>();
	private Map requestTypeMap = new HashMap();
	
	public void prepare() {
		super.prepare();
		// 加载请求类型
		requestTypeMap = nspFatallogRequsetSumService.getrequestTypeMap();
		if (this.selectedId != null && !this.selectedId.equals("")) {
			this.nspFatallogRequsetSum = nspFatallogRequsetSumService
					.getNspFatallogRequsetSum(Long.parseLong(selectedId));
		}
	}
	
	public String queryByPage() {
		initPageRender();
		
		Map queryMap = new HashMap();
		queryMap.put("logDate", query_logDate);
		queryMap.put("query_logDate_end", query_logDate_end);
		queryMap.put("requestType", query_requestType);

		resultList = nspFatallogRequsetSumService
				.queryNspFatallogDayCountByPage(queryMap, pageRender);

		setPageRenderToRequest();

		return "query";
	}

	public NspFatallogRequsetSum getNspFatallogRequsetSum() {
		return nspFatallogRequsetSum;
	}

	public void setNspFatallogRequsetSum(NspFatallogRequsetSum nspFatallogRequsetSum) {
		this.nspFatallogRequsetSum = nspFatallogRequsetSum;
	}

	public NspFatallogRequsetSumService getNspFatallogRequsetSumService() {
		return nspFatallogRequsetSumService;
	}

	public void setNspFatallogRequsetSumService(
			NspFatallogRequsetSumService nspFatallogRequsetSumService) {
		this.nspFatallogRequsetSumService = nspFatallogRequsetSumService;
	}

	public String getSelectedId() {
		return selectedId;
	}

	public void setSelectedId(String selectedId) {
		this.selectedId = selectedId;
	}

	public String getQuery_logDate() {
		return query_logDate;
	}

	public void setQuery_logDate(String query_logDate) {
		this.query_logDate = query_logDate;
	}

	public String getQuery_requestType() {
		return query_requestType;
	}

	public void setQuery_requestType(String query_requestType) {
		this.query_requestType = query_requestType;
	}

	public Map getRequestTypeMap() {
		return requestTypeMap;
	}

	public void setRequestTypeMap(Map requestTypeMap) {
		this.requestTypeMap = requestTypeMap;
	}

	public String getQuery_logDate_end() {
		return query_logDate_end;
	}

	public void setQuery_logDate_end(String query_logDate_end) {
		this.query_logDate_end = query_logDate_end;
	}

	public List<Map> getResultList() {
		return resultList;
	}

	public void setResultList(List<Map> resultList) {
		this.resultList = resultList;
	}
}
